<template>
  <div>
    <div class="recommend-title">热销推荐</div>
    <div class="recommend-list">
        <router-link 
            class="recommend-item" 
            v-for="item of recommendList"
            :key="item.id"
            :to="'/detail/' + item.id"
            >
            <img :src="item.imgUrl" alt="" class="recommend-img">
            <div class="recommend-info">
                <p class="recommend-head">{{item.title}}</p>
                <p class="recommend-desc">{{item.desc}}</p>
                <button class="recommend-btn">查看详情</button>
            </div>
        </router-link>
    </div>
  </div>
</template>
<script>
  export default {
    name: 'HomeRecommend',
    props: {
        recommendList: Array
    }
  }
</script>
<style lang="stylus" scoped>
@import '~styles/varibles.styl'
@import '~styles/mixins.styl'
.recommend
    &-title 
        font-size:  .32rem
        margin-top: .2rem
        line-height: .8rem
        background: #eee
        text-indent: .2rem
    &-item
        overflow: hidden
        display: flex
        height: 1.9rem
    &-img
        width: 1.7rem
        height: 1.7rem
        padding: .1rem
    &-info
        flex: 1
        padding: .1rem
        min-width: 0
        font-size: 0
    &-head
        line-height: .54rem
        font-size: .32rem
        color: $darkTextColor
        ellipsis()
    &-desc
        line-height: .4rem
        font-size: .28rem
        color: #ccc
        ellipsis()
    &-btn
        line-height: .44rem
        margin-top: .16rem
        padding: 0 .2rem
        font-size: .28rem
        color: #fff
        border-radius: .06rem
        background-color: #ff9300
</style>
